package chapter9;

import java.util.SortedMap;

public class Demo3 {
    public static void main(String[] args) {
        //角的表达90度：π/2， 180度：π， 360度：2π
        System.out.println("90度的正弦值" + Math.sin(Math.PI/2));
        System.out.println("余弦：" + Math.cos(0));
        System.out.println("正切：" + Math.tan(Math.PI/3));
        System.out.println("反正弦：" + Math.asin(Math.sqrt(2)/2));
        System.out.println("反余弦：" + Math.acos(Math.sqrt(2)/2));
        System.out.println("反正切：" + Math.atan(1));
        System.out.println("120弧度：" + Math.toRadians(120));
        System.out.println("π/2的弧度：" + Math.toDegrees(Math.PI/2));
        System.out.println("4的平方根" + Math.sqrt(4));
        System.out.println("8的立方根:" + Math.cbrt(8));
        System.out.println("2的平方：" + Math.pow(2,2));
        System.out.println("e的平方：" + Math.exp(2));
        System.out.println("log100:" +  Math.log(100));

        System.out.println("向上取整：" + Math.ceil(5.2));
        System.out.println("向下取整：" + Math.floor(2.6));
        System.out.println(Math.rint(2.5));
        System.out.println(Math.rint(2.3) + "," + Math.rint(2.7));
        System.out.println(Math.round(2.4f));
        System.out.println(Math.round(2.5));

        System.out.println("取最大：" + Math.max(4,8));
        System.out.println("取最小：" + Math.min(4,8));
        System.out.println("绝对值：" + Math.abs(-7));
    }
}
